package sumOfMultiples;

public class Solution {
    public int sumOfMultiples(int n) {
        int sum=0;
        for (int i = 3; i <=n ; i++) {
            if(check(i)){
                sum+=i;
            }
        }
        return sum;
    }
    private boolean check(int n){
        return n%3==0||n%5==0||n%7==0;
    }
}
